package command.macro;

import command.Command;

/**
 * Created by lenovo on 2018/1/4.
 */
public class MacroCommand implements Command {
    Command[] commands;

    public MacroCommand(Command[] commands) {
        this.commands = commands;
    }

    @Override
    public void execute() {
        for(Command c:commands){
            c.execute();
        }
    }

    @Override
    public void undo() {

        for(Command c:commands){
            c.undo();
        }
    }
}
